package com.fuxin.security.test.dao;

import com.fuxin.security.test.entity.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface RoleMapper extends JpaRepository<Role, Long> {

    @Query(value = "select r from Role r , User u  where u.id = :id")
    List<Role> getRolesByUserId(Long id);
}
